<%@ page import="java.util.List" %>
<%@ page import="model.Essay" %><%--
  Created by IntelliJ IDEA.
  User: 12138
  Date: 2020/12/22
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>文章</title>
    <link rel="stylesheet" type="text/css" href="css/style_essay1.css">
    <script type="text/javascript" src="js/jquery-3.5.1.js"></script>
    <script type="text/javascript" src="js/essay.js"></script>
</head>
<%
    List<String[]> essayLabelList=(List<String[]>)session.getAttribute("essayLabelList");
    Essay essay=(Essay)session.getAttribute("essay");
%>
<body>
<div id="head">
    <a class="btn pill fill " id="btn_back">返回首页 </a>
</div>
<div id="body">
    <h1 id="title">Spring Boot 2.4 对多环境配置的支持更改</h1>
    <div id="label_backgound"></div>
    <div id="essay_main">

    </div>
<div id="bottom">
    <p>Copyright©2020 仓颉博客版权所有</p>
</div>
<div id="zan">
    <img src="img/zan.png">

</div>
    <form method="post" action="/QM_war_exploded/ZanAdd"  hidden="true">
        <input type="hidden" name="eid" value="<%=essay.getEid()%>">
        <input type="submit" id="zanSubmit">
    </form>
</div>
</body>

<script type="text/javascript" src="js/jquery-3.5.1.js"></script>
<script type="text/javascript" >
    $(function(){
        init()
        function init (){
            $("#title").html('<%=essay.getTitle()%>')
            var str1= '        <b class="essay_label" id="time"><%=essay.getCreate_time()%></b><b class="essay_label" id="read_sum">阅读量：<%=essay.getRead_sum()%></b><b class="essay_label" id="zan_sum">赞：<%=essay.getZan_sum()%></b><br>\n' +
                '        <b class="essay_label" id="lei">分栏：<%=essay.getEclass()%></b><b class="essay_label" >标签：</b>'
            <%for (String[] s : essayLabelList) {%>
            str1+='<div class="lable_item">&nbsp;#<%=s[2]%>#&nbsp;</div>'
            <%}%>

            str1+='<b class="essay_label" >作者：<%=essay.getAuther()%></b>\n' +
                '        <br>\n'
            $("#label_backgound").append(str1)
            var str='<%=essay.getContent()%>'

            $("#essay_main").append(str)


        }
        $("#zan").on("click",function(){
            if(sessionStorage.getItem("isReload<%=essay.getEid()%>")){
                alert("你已经赞过了");

            }else{
                alert("谢谢你的支持！")
                $("#zanSubmit").click();
                sessionStorage.setItem("isReload<%=essay.getEid()%>", true)
            }

        });

    })
</script>
</html>

